import  re
import  requests
url = "https://casad.cas.cn/ysxx2022/ysmd/sxwl/200906/t20090626_1854608.html"
url = "http://casad.cas.cn/ysxx2022/ysmd/smkx/202306/t20230606_4893999.html"#410微软雅黑
url = "http://casad.cas.cn/ysxx2022/ysmd/dxb/200906/t20090624_1804453.html"#472
url = "http://casad.cas.cn/ysxx2022/ysmd/dxb/200912/t20091203_2681377.html"#581微软雅黑
# url = "https://casad.cas.cn/ysxx2022/ysmd/sxwl/200906/t20090626_1854608.html"#590空
# url = "https://casad.cas.cn/ysxx2022/ysmd/sxwl/200906/t20090626_1854608.html"#636空
# url = "https://casad.cas.cn/ysxx2022/ysmd/sxwl/200906/t20090626_1854608.html"#679空
# url = "https://casad.cas.cn/ysxx2022/ysmd/sxwl/200906/t20090626_1854608.html"#689空
# url = "https://casad.cas.cn/ysxx2022/ysmd/sxwl/200906/t20090626_1854608.html"#698空
# url = "https://casad.cas.cn/ysxx2022/ysmd/sxwl/200906/t20090626_1854608.html"#410微软雅黑
# url = "https://casad.cas.cn/ysxx2022/ysmd/sxwl/200906/t20090626_1854608.html"#410微软雅黑
dic={
    "User-Agent": "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Mobile Safari/537.36 Edg/126.0.0.0"
}
resp = requests.get(url, headers=dic)
resp.encoding = "utf-8"
obj3_sqecial = re.compile(r'<script>.*?var currentChannel1 = "(?P<bumen>.*?)"'
                 r'.*?<p class="wztitle">(?P<name>.*?)</p>'
                 r'.*?<div class="acadImg"><img src="(?P<imgul>.*?)".*?<div class="acadTxt">.*>(?P<style>.*?)家'
                 r'，.*?>(?P<work>.*?)<.*。(?P<born>.*?)<.*?>生于(?P<home>.*?)</span>。.*?。(?P<year>.*?)当选.*?<div class="Previous_Next" style="overflow: hidden; width: 100%;">'
                 ,re.S)
obj3= re.compile(r'<script>.*?var currentChannel1 = "(?P<bumen>.*?)"'
                 r'.*?<p class="wztitle">(?P<name>.*?)</p>'
                 r'.*?<div class="acadImg"><img src="(?P<imgul>.*?)"'
                 r'.*?<div class="acadTxt">.*>(?P<style>.*?)家，(?P<work>.*?)。(?P<born>.*?)生于(?P<home>.*?)，.*，(?P<year>.*?)当选'
                 r'.*?<div class="Previous_Next" style="overflow: hidden; width: 100%;">',re.S)
# result = obj3_sqecial.search(resp.text)
result = obj3.search(resp.text)

print(result.group("bumen"))
print((url[:46] + result.group("imgul").strip("./")))

print(result.group("name"))
print(result.group("style"))
print(result.group("work"))
print(result.group("born"))
print(result.group("home"))
print(result.group("year"))


